<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>假设两个整数 a 和 b ，找出其最⼤公约数</title>
</head>

<body>
  <script>
    function aa(a, b) {
      if (b == 0) {
        return a
      }
      else {
        return aa(b, a % b)
      }
    }
    console.log(aa(18, 30));
  </script>
</body>

</html>